<h2>Accessing via the backend log</h2>
<p>In the&nbsp;<a class="reference-link" href="#root/_help_x3i7MxGccDuM">Global menu</a>,
  go to Advanced → Show backend log</p>
<h2>Location on the disk</h2>
<p>Backend logs are stored on the file system. To find them, open the&nbsp;
  <a
  class="reference-link" href="#root/_help_tAassRL4RSQL">Data directory</a>, go to the <code>log</code> subdirectory and find the
    latest log file, e.g. <code>trilium-2022-12-14.log</code>.&nbsp;</p>
<h2>Reporting backend bugs</h2>
<p>You can attach the whole file to the bug report (preferable) or open it
  and copy-paste only the last lines / lines you believe are relevant.</p>
<h2>Customizing the retention of logs</h2>
<p>The backend logs are fully managed by the Trilium server. By default the
  last 90 days worth of logs are kept; the logs older than that are deleted
  in order to reduce the space consumption.</p>
<p>It's possible to change the retention period by modifying the&nbsp;
  <a
  class="reference-link" href="#root/_help_Gzjqa934BdH4">Configuration (config.ini or environment variables)</a>&nbsp;via the <code>.ini</code> file:</p><pre><code class="language-text-x-trilium-auto">[Logging]
retentionDays=7</code></pre>
<p>Or via the environment variable <code>TRILIUM_LOGGING_RETENTION_DAYS</code>.</p>
<p>Special cases:</p>
<ul>
  <li>Positive values indicate the number of days worth of logs to keep</li>
  <li>A value of 0 results with the default value (90 days) to be used</li>
  <li>Negative values (e.g. <code>-1</code>) result with all logs to be kept,
    irrespective how ancient and numerous (and</li>
</ul>
<aside class="admonition note">
  <p>If you set the retention days to a low number, you might notice that not
    all the log files are being deleted. This is because a minimum number of
    logs (7 at the time of writing) is maintained at all times.</p>
</aside>